﻿using System;
using System.Collections.Generic;

namespace HYCodeBase.CommonUtility
{
	public static class GenericUtilityMethod
	{
		public static int CompressArrayByContains<T>(List<T> arElements)
		{
			List<T> list = new List<T>();
			foreach (T item in arElements)
			{
				if (!list.Contains(item))
				{
					list.Add(item);
				}
			}
			arElements.Clear();
			foreach (T item2 in list)
			{
				arElements.Add(item2);
			}
			return arElements.Count;
		}
	}
}
